package com.ymttest.database.mongo.jproduct;

import java.util.ArrayList;
import java.util.Map;

import com.ymt.database.MongoDBDriver;
import com.ymttest.database.mongo.YmtMongoDriverFactroy;

public class ProductDescExtraNewWapper {
	private MongoDBDriver mdd = YmtMongoDriverFactroy.getInstance_YmtProductDBdriverNewJava("ProductDescExtra");

	public Map<String,Object> getByProductId(String productId) throws Exception {
		ArrayList<Map> list = mdd.selectPartLimitToMap("{\"spid\":\"" + productId + "\"}",1);
	    
	    return list.size()>0?list.get(0):null;
	}
	     
	public int getCountByProductId(String productId) throws Exception{
		return mdd.selectPartLimitToMap("{\"spid\":\"" + productId + "\"}",50).size();
	}
	
	
	public static void main(String[] args) throws Exception {
		Map<String, Object> aMap = new ProductDescExtraNewWapper().getByProductId("1eab4b17-486d-4f31-aa37-94be0646cd6f");
		System.out.println();
	}
	

}
